The TADS Alternate Library
Version 2.0

Enterable Objects


Copyright 2000 by Kevin Forchione.
This is part of the TADS Alternate Library Authors Manual.

Introduction and Table of Contents




Enterable Objects

 

The EnterableOpenable class provides a means for actors to enter objects that act like DarkRooms when closed or as NestedRooms when open. The EnterableOpenable is ideal for creating boxes, sleeping bags, tents, and other objects that can be opened and closed.

 

The insideDesc Attribute

 

If you want to display a description pertaining to when an actor is inside the Enterable then you should define an insideDesc.

 

          insideDesc = “The inside of the box is a cramped narrow space.”

 

This is displayed when the actor does a look from inside the Enterable.

 

An Example

 

Suppose we want a box that our PC can climb into and shut. Using the EnterableOpenable class we define our box.

 

largeBox: EnterableOpenable

    location = kitchen

    noun = 'box'

    adjective = 'large'

    sDesc = "large box"

    insideDesc = "The inside of <<self.theDesc>> is a cramped narrow

        space.";

 

Kitchen

       This is the Kitchen. An archway to the north leads to the pantry.

       You see a stove and a large box here.

 

>x box

The large box is open. There's nothing in the large box.

 

>get in box

Okay, you're now standing in the large box.

 

Enterable class objects have boardingPosture set to standing (see Object Postures). We’ll look at this some more below, but for now we’ll look at the Room display.

 

>l

Kitchen, standing in the large box

       This is the Kitchen. An archway to the north leads to the pantry.

       You see a stove here.

       The inside of the large box is a cramped narrow space.

         

The first line of the display is the same as that displayed on the Alt status line. This line displays the actor’s posture as well as the Enterable’s boardingPrep.

 

The second line is the ldesc of the kitchen. The third is the general listing for the kitchen. The fourth line is the insideDesc of our box.

 

 >sit in box

Okay, you're now sitting in the large box.

 

>get in box

Okay, you're now standing in the large box.

 

>close box

Closed.

 

In the dark.

       It's pitch black.

 

>n

You stumble around in the dark, and don't get anywhere.

 

>i

It's pitch black.

 

>open box

Opened.

 

Kitchen, standing in the large box

       This is the Kitchen. An archway to the north leads to the pantry.

       You see a stove here.

       The inside of the large box is a cramped narrow space.

         

Because Enterable objects possess behaviours of Rooms, NestedRooms, and DarkRooms, while having a few special characteristics of their own. For instance, you can always open an Enterable object, even in the dark. Enterable objects possess the posture behaviours of BedItems, which means that you can sit, stand, or lie in the EnterableObject.

 

>sit in box

Okay, you're now sitting in the large box.

 

>lie in box

Okay, you're now lying in the large box.

 

Enterable objects are portable, unlike ChairItems, BedItems, or Vehicles. However an Enterable will not allow you to manipulate it while you are inside. You cannot take, throw, or otherwise move an Enterable from inside.